#pragma once
#include "StdAfx.h"
#include "Block.h"
#include <vector>


class ObstacleMap
{
public:
	static const int OBSTACLE_DEFAULT_MAX_NUMBER = 5;
	static const int OBSTACLE_DEFAULT_MIN_NUMBER = 2;
	static const float OBSTACLE_DEFAULT_LEN_X;
	static const float OBSTACLE_DEFAULT_LEN_Y;
	static const float OBSTACLE_DEFAULT_LEN_Z;

	ObstacleMap(void);
	~ObstacleMap(void);

	void init(int startX, int startY, int endX, int endY);
	void render(long time);
	void RandomizeObstacleMap();
	void AddObstacle(BlockType type, int x, int z);
	Block *collides(D3DXVECTOR3 pt);
	Block *get(int i)
	{
		if (i > 0 && i < blocks.size())
		{
			return blocks[i];
		}
		else return NULL;
	}

	int size(void) { return blocks.size(); }

protected:
	RECT boundingBox;
	std::vector<Block*> blocks;
};


